﻿@model CountryModel

@{
    const string hideInfoBlockAttributeName = "CountryPage.HideInfoBlock";
    var hideInfoBlock = genericAttributeService.GetAttribute<bool>(workContext.CurrentCustomer, hideInfoBlockAttributeName);

    const string hideStatesBlockAttributeName = "CountryPage.HideStatesBlock";
    var hideStatesBlock = genericAttributeService.GetAttribute<bool>(workContext.CurrentCustomer, hideStatesBlockAttributeName, defaultValue: true);
}

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />

<div class="content">
    <div class="form-horizontal">
        <nop-panels id="country-panels">
            <nop-panel asp-name="country-info" asp-icon="fa fa-info" asp-title="@T("Admin.Configuration.Countries.Info")" asp-hide-block-attribute-name="@hideInfoBlockAttributeName" asp-hide="@hideInfoBlock" asp-advanced="false">@await Html.PartialAsync("_CreateOrUpdate.Info", Model)</nop-panel>
            <nop-panel asp-name="country-states" asp-icon="fa fa-globe"asp-title="@T("Admin.Configuration.Countries.States")" asp-hide-block-attribute-name="@hideStatesBlockAttributeName" asp-hide="@hideStatesBlock" asp-advanced="false">@await Html.PartialAsync("_CreateOrUpdate.States", Model)</nop-panel>
            
            @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.CountryDetailsBlock, additionalData = Model })
        </nop-panels>
    </div>
</div>